//
//  LunarEntity.swift
//  SimpleCal
//
//  Created by 杜晓祥 on 2021/10/19.
//

import Foundation

struct  LunarEntity:CustomStringConvertible{
    
    var  year:Int = 0
    var  month:Int = 0
    var  day:Int = 0
    
    init() {
    }
    
    var GZYear:String {
        return CalendarUtil.getLunarGZYear(year: year)
    }
    
    var SXYear:String {
        return CalendarUtil.getLunarSXYear(year: year)
    }
    
    var monthStr:String {
        return CalendarUtil.getLunarMonthStr(month: month)
    }
    var dayToMonthStr:String {
        if day == 1 {
            return monthStr
        }
        return CalendarUtil.getLunarDayStr(day: day)
    }
    var dayStr:String {
        return CalendarUtil.getLunarDayStr(day: day)
    }
    
    var lunarYear:String {
        return GZYear + "(\(SXYear))年"
    }
    
    var lunarMonthDay: String {
        return monthStr + dayStr
    }
    
    var description: String {
        return GZYear + "(" + SXYear + ")年" + monthStr + dayStr
    }
}
